package com.hqu.ms.utils;

import com.hqu.ms.R;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class ToastUtils {
	public static void showToast(Context mContext, String msg){
		View view = LayoutInflater.from(mContext).inflate(R.layout.toast_view, null);
		TextView tv = (TextView)view.findViewById(R.id.toast_text);
		tv.setText(msg);
		Toast toast = new Toast(mContext);
		toast.setView(view);
		toast.setDuration(Toast.LENGTH_SHORT);
		toast.show();
	}
	
	public static void showToast(Context mContext, String msg, boolean top){
		View view = LayoutInflater.from(mContext).inflate(R.layout.toast_view, null);
		TextView tv = (TextView)view.findViewById(R.id.toast_text);
		tv.setText(msg);
		Toast toast = new Toast(mContext);
		toast.setView(view);
		toast.setDuration(Toast.LENGTH_SHORT);
		toast.setGravity(Gravity.TOP, 0, 150);
		toast.show();
	}
}
